package com.hongxun.design.activitys;

import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.TextAppearanceSpan;
import android.view.View;
import android.widget.TextView;

import com.hongxun.design.R;
import com.hongxun.design.interfaces.HeadSecond;
import com.hongxun.design.listeners.ListenerSet;
import com.hongxun.design.mytools.IconSourse;
import com.hongxun.design.mytools.SetTypeface;
import com.hongxun.design.ui.headandbottonpanel.HeadSecondControlPanel;
import com.hongxun.design.utils.ActionSheetUtil;
import com.hongxun.design.utils.DataUtil;

/**
 * Created by zerdoor_pc on 2016/6/24.
 * 面对面快传
 */
public class FacingEachActivity extends BaseActivity implements HeadSecond {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_facingeach);
        findBar();
        findView();
    }

    @Override
    public void findBar() {
        HeadSecondControlPanel headsecond_layout = (HeadSecondControlPanel) findViewById(R.id.synchronization_layout);
        headsecond_layout.initHeadPanel(DataUtil.getsecondbean("", View.GONE, R.color.bar_right, ListenerSet.back, "面对面快传", R.color.title, View.VISIBLE, IconSourse.BACK + "", View.VISIBLE));
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void findView() {
        super.findView();
        TextView face_icon = (TextView) findViewById(R.id.face_icon);
        TextView face_send = (TextView) findViewById(R.id.face_send);
        TextView face_receive = (TextView) findViewById(R.id.face_receive);

        SetTypeface.set(face_icon, IconSourse.freeflow);

        SetTypeface.set(face_send, IconSourse.send);

        SpannableString styledText1 = new SpannableString(" 发送");
        styledText1.setSpan(new TextAppearanceSpan(this, R.style.style18), 0, 3, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        face_send.append(styledText1);
        //face_send.append(" 发送");

        SetTypeface.set(face_receive, IconSourse.receive);
        SpannableString styledText2 = new SpannableString(" 接收");
        styledText2.setSpan(new TextAppearanceSpan(this, R.style.style18), 0, 3, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        face_receive.append(styledText2);
        //face_receive.append(" 接收");

    }

    /**点击事件**/

    /**
     * 发送*
     */
    public void Send(View v) {
       ActionSheetUtil.openSheetForChoiceSend(this, "发送项目文件", "发送项目基本信息");

    }

    /**
     * 接收*
     */
    public void Receive(View v) {
        ActionSheetUtil.openSheetForChoiceReceive(this, "接收项目文件", "接收项目基本信息");

    }
}
